package com.treasure.mall.biz.dto.live;

import lombok.Data;

/**
 *
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.biz.dto.live
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/7/3 15:33
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 * Copyright 2019-2022 com.treasure.mall.biz.dto.live Inc. All rights reserved.
 */
@Data
public class LiveRobotConfigDTO {

    private boolean enable;

    /**
     * 最小频率 秒
     */
    private int min = 1;
    /**
     * 最大频率 秒
     */
    private int max = 30;

    private Long liveRoomId;


    public int getMin() {
        if (min > 0) {
            return min;
        }
        return 1;
    }

    public int getMax() {

        if (max >= getMin()) {
            return max;
        }

        if (max > 0) {
            return getMin() + max;
        }

        return getMin() + 5;
    }


}
